package com.glory.brepda.adapter;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.glory.brepda.R;
import com.glory.brepda.entity.PackageDetailListEntity;
import com.pda.platform.ui.ui_pdaplatform.utils_public.FreeApi_LogUtils;

import java.util.List;

import androidx.annotation.Nullable;

/**
 * FileName: PublicAuditListAdapter
 * Author: XJH
 * Date: 2020/6/19 16:23
 * Description:
 * History:
 */
public class PublicAuditListAdapter extends BaseQuickAdapter<PackageDetailListEntity, BaseViewHolder> {
    private boolean mAuditType;
    private String isboxCheck;

    public PublicAuditListAdapter(@Nullable List<PackageDetailListEntity> data, boolean auditType,String isboxCheck) {
        super(R.layout.item_bin_info_list, data);
        this.mAuditType = auditType;
        this.isboxCheck = isboxCheck;
    }

    @Override
    protected void convert(BaseViewHolder helper, PackageDetailListEntity item) {
        helper.setVisible(R.id.tvPosition, true);
        helper.setText(R.id.tvPosition, String.valueOf(helper.getAdapterPosition() + 1));
        if (mAuditType) {
            helper.setText(R.id.list_tv2, item.getPACKLOTID());
            helper.setText(R.id.list_tv1, item.getWOID());
        } else {
            //外箱审核不显示tvPosition
            helper.setGone(R.id.tvPosition, false);
            if (isboxCheck.equals("boxCheck")){
                helper.setText(R.id.list_tv1, item.getPACKLOTID());
                helper.setText(R.id.list_tv2, item.getCHECKPACKLOTID());
            }else {
                helper.setText(R.id.list_tv1, item.getPACKLOTID());
                helper.setText(R.id.list_tv2, item.getWOID());
            }
        }

        helper.setGone(R.id.list_tv3, false);

    }
}
